﻿// ControlDlg.cpp: 实现文件
//

#include "pch.h"
#include "ProjectAA.h"
#include "ControlDlg.h"
#include "afxdialogex.h"


// CControlDlg 对话框

IMPLEMENT_DYNAMIC(CControlDlg, CDialogEx)

CControlDlg::CControlDlg(CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_DIALOG_CONTROL, pParent)
{

}

CControlDlg::~CControlDlg()
{
}

void CControlDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_EDIT1, m_editStepDis);
	DDX_Control(pDX, IDC_STATIC_POS, m_staticAAX);
	DDX_Control(pDX, IDC_STATIC_POS2, m_staticAAY);
	DDX_Control(pDX, IDC_STATIC_POS3, m_staticAAZ);
	DDX_Control(pDX, IDC_STATIC_POS4, m_staticAAXt);
	DDX_Control(pDX, IDC_STATIC_POS5, m_staticAAYt);
	DDX_Control(pDX, IDC_STATIC_POS6, m_staticAAZt);
	DDX_Control(pDX, IDC_STATIC_POS21, m_staticAATabX);
	DDX_Control(pDX, IDC_STATIC_POS14, m_staticAACrtZ);
}


BEGIN_MESSAGE_MAP(CControlDlg, CDialogEx)
	ON_WM_TIMER()
	ON_BN_CLICKED(IDC_BUTTON1, &CControlDlg::OnBnClickedButton1)
	ON_BN_CLICKED(IDC_BUTTON4, &CControlDlg::OnBnClickedButton4)
	ON_BN_CLICKED(IDC_BUTTON2, &CControlDlg::OnBnClickedButton2)
	ON_BN_CLICKED(IDC_BUTTON3, &CControlDlg::OnBnClickedButton3)
	ON_BN_CLICKED(IDC_BUTTON6, &CControlDlg::OnBnClickedButton6)
	ON_BN_CLICKED(IDC_BUTTON5, &CControlDlg::OnBnClickedButton5)
	ON_BN_CLICKED(IDC_BUTTON8, &CControlDlg::OnBnClickedButton8)
	ON_BN_CLICKED(IDC_BUTTON7, &CControlDlg::OnBnClickedButton7)
	ON_BN_CLICKED(IDC_BUTTON10, &CControlDlg::OnBnClickedButton10)
	ON_BN_CLICKED(IDC_BUTTON9, &CControlDlg::OnBnClickedButton9)
	ON_BN_CLICKED(IDC_BUTTON24, &CControlDlg::OnBnClickedButton24)
	ON_BN_CLICKED(IDC_BUTTON23, &CControlDlg::OnBnClickedButton23)
	ON_BN_CLICKED(IDC_BUTTON11, &CControlDlg::OnBnClickedButton11)
	ON_BN_CLICKED(IDC_BUTTON25, &CControlDlg::OnBnClickedButton25)
	ON_BN_CLICKED(IDC_BUTTON26, &CControlDlg::OnBnClickedButton26)
	ON_BN_CLICKED(IDC_BUTTON27, &CControlDlg::OnBnClickedButton27)
	ON_BN_CLICKED(IDC_BUTTON28, &CControlDlg::OnBnClickedButton28)
	ON_BN_CLICKED(IDC_BUTTON29, &CControlDlg::OnBnClickedButton29)
	ON_BN_CLICKED(IDC_BUTTON30, &CControlDlg::OnBnClickedButton30)
	ON_BN_CLICKED(IDC_BUTTON31, &CControlDlg::OnBnClickedButton31)
	ON_BN_CLICKED(IDC_BUTTON32, &CControlDlg::OnBnClickedButton32)
	ON_BN_CLICKED(IDC_BUTTON33, &CControlDlg::OnBnClickedButton33)
	ON_BN_CLICKED(IDC_JACK_CYLINDER, &CControlDlg::OnBnClickedJackCylinder)
	ON_BN_CLICKED(IDC_CONTECT_CYLINDER, &CControlDlg::OnBnClickedContectCylinder)
	ON_BN_CLICKED(IDC_GRIPPER, &CControlDlg::OnBnClickedGripper)
	ON_BN_CLICKED(IDC_STOP1, &CControlDlg::OnBnClickedStop1)
	ON_BN_CLICKED(IDC_STOP2, &CControlDlg::OnBnClickedStop2)
	ON_BN_CLICKED(IDC_START_UV, &CControlDlg::OnBnClickedStartUv)
	ON_BN_CLICKED(IDC_SAFE_DOOR, &CControlDlg::OnBnClickedSafeDoor)
	ON_BN_CLICKED(IDC_FIX1_CYLINDER, &CControlDlg::OnBnClickedFix1Cylinder)
	ON_BN_CLICKED(IDC_FIX2_CYLINDER, &CControlDlg::OnBnClickedFix2Cylinder)
	ON_BN_CLICKED(IDC_PLC_READ, &CControlDlg::OnBnClickedPlcRead)
	ON_BN_CLICKED(IDC_PLC_WRITE, &CControlDlg::OnBnClickedPlcWrite)
	ON_BN_CLICKED(IDC_PLC_READ_AIM, &CControlDlg::OnBnClickedPlcReadAim)
	ON_BN_CLICKED(IDC_PLC_ORDER1, &CControlDlg::OnBnClickedPlcOrder1)
	ON_BN_CLICKED(IDC_PLC_ORDER2, &CControlDlg::OnBnClickedPlcOrder2)
	ON_BN_CLICKED(IDC_PLC_ORDER3, &CControlDlg::OnBnClickedPlcOrder3)
	ON_BN_CLICKED(IDC_PLC_ORDER4, &CControlDlg::OnBnClickedPlcOrder4)
	ON_BN_CLICKED(IDC_PLC_ORDER5, &CControlDlg::OnBnClickedPlcOrder5)
	ON_BN_CLICKED(IDC_PLC_ORDER6, &CControlDlg::OnBnClickedPlcOrder6)
	ON_BN_CLICKED(IDC_PLC_READ_AIM2, &CControlDlg::OnBnClickedPlcReadAim2)
	ON_BN_CLICKED(IDC_BUTTON55, &CControlDlg::OnBnClickedButton55)
	ON_BN_CLICKED(IDC_BUTTON57, &CControlDlg::OnBnClickedButton57)
	ON_BN_CLICKED(IDC_BUTTON54, &CControlDlg::OnBnClickedButton54)
	ON_BN_CLICKED(IDC_BUTTON56, &CControlDlg::OnBnClickedButton56)
	ON_BN_CLICKED(IDC_BUTTON34, &CControlDlg::OnBnClickedButton34)
	ON_BN_CLICKED(IDC_BUTTON35, &CControlDlg::OnBnClickedButton35)
END_MESSAGE_MAP()


// CControlDlg 消息处理程序


BOOL CControlDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	SetTimer(TIMER_CONTROL_AXIS_POS, 500, NULL);

	CString cstr;
	cstr.Format(L"0");
	m_editStepDis.SetWindowTextW(cstr);

	return TRUE;
}


void CControlDlg::OnCancel()
{
	KillTimer(TIMER_CONTROL_AXIS_POS);

	CDialogEx::OnCancel();
}


void CControlDlg::OnTimer(UINT_PTR nIDEvent)
{
	if (nIDEvent == TIMER_CONTROL_AXIS_POS)
	{
		CString cstr;
		cstr.Format(L"%d", gSystemMgr.m_vCMotor[MOTOR_X].m_nCurPositon);
		m_staticAAX.SetWindowTextW(cstr);
		cstr.Format(L"%d", gSystemMgr.m_vCMotor[MOTOR_Y].m_nCurPositon);
		m_staticAAY.SetWindowTextW(cstr);
		cstr.Format(L"%d", gSystemMgr.m_vCMotor[MOTOR_Z].m_nCurPositon);
		m_staticAAZ.SetWindowTextW(cstr);
		cstr.Format(L"%d", gSystemMgr.m_vCMotor[MOTOR_Xt].m_nCurPositon);
		m_staticAAXt.SetWindowTextW(cstr);
		cstr.Format(L"%d", gSystemMgr.m_vCMotor[MOTOR_Yt].m_nCurPositon);
		m_staticAAYt.SetWindowTextW(cstr);
		cstr.Format(L"%d", gSystemMgr.m_vCMotor[MOTOR_Zt].m_nCurPositon);
		m_staticAAZt.SetWindowTextW(cstr);

		cstr.Format(L"%d", gSystemMgr.m_vCMotor[Table_X].m_nCurPositon);
		m_staticAATabX.SetWindowTextW(cstr);
		cstr.Format(L"%d", gSystemMgr.m_vCMotor[Chart_Z].m_nCurPositon);
		m_staticAACrtZ.SetWindowTextW(cstr);

	}

	CDialogEx::OnTimer(nIDEvent);
}


void CControlDlg::OnBnClickedButton1()
{
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[MOTOR_X].m_sAxisSetting.m_dTargetPos = _ttof(cstr);
	gSystemMgr.m_vCMotor[MOTOR_X].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton4()
{
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[MOTOR_X].m_sAxisSetting.m_dTargetPos = -_ttof(cstr);
	gSystemMgr.m_vCMotor[MOTOR_X].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton2()
{
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Y].m_sAxisSetting.m_dTargetPos = _ttof(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Y].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton3()
{
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Y].m_sAxisSetting.m_dTargetPos = -_ttof(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Y].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton6()
{
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Z].m_sAxisSetting.m_dTargetPos = _ttof(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Z].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton5()
{
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Z].m_sAxisSetting.m_dTargetPos = -_ttof(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Z].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton8()
{
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Xt].m_sAxisSetting.m_dTargetPos = _ttof(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Xt].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton7()
{
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Xt].m_sAxisSetting.m_dTargetPos = -_ttof(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Xt].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton10()
{
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Yt].m_sAxisSetting.m_dTargetPos = _ttof(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Yt].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton9()
{
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Yt].m_sAxisSetting.m_dTargetPos = -_ttof(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Yt].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton24()
{
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Zt].m_sAxisSetting.m_dTargetPos = _ttof(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Zt].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton23()
{
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Zt].m_sAxisSetting.m_dTargetPos = -_ttof(cstr);
	gSystemMgr.m_vCMotor[MOTOR_Zt].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton11()
{
	gSystemMgr.m_vCMotor[MOTOR_X].StopMove();
	gSystemMgr.m_vCMotor[MOTOR_Y].StopMove();
	gSystemMgr.m_vCMotor[MOTOR_Z].StopMove();
	gSystemMgr.m_vCMotor[MOTOR_Xt].StopMove();
	gSystemMgr.m_vCMotor[MOTOR_Yt].StopMove();
	gSystemMgr.m_vCMotor[MOTOR_Zt].StopMove();

	gSystemMgr.m_vCMotor[Table_X].StopMove();
	gSystemMgr.m_vCMotor[Chart_Z].StopMove();
}


void CControlDlg::OnBnClickedButton25()
{//去夹镜头位
	gSystemMgr.m_nButtonValue = 18;
}


void CControlDlg::OnBnClickedButton26()
{//去镜头上方位
	gSystemMgr.m_nButtonValue = 19;
}


void CControlDlg::OnBnClickedButton27()
{//SearchZ
	gSystemMgr.m_nButtonValue = 22;
}


void CControlDlg::OnBnClickedButton28()
{//MoveCenter
	gSystemMgr.m_nButtonValue = 23;
}


void CControlDlg::OnBnClickedButton29()
{//AA
	gSystemMgr.m_nButtonValue = 24;
}


void CControlDlg::OnBnClickedButton30()
{//胶缩补偿
	gSystemMgr.m_nButtonValue = 26;
}


void CControlDlg::OnBnClickedButton31()
{//完整动作
	gSystemMgr.m_nButtonValue = 25;
}


void CControlDlg::OnBnClickedButton32()
{//去AA开始位
	gSystemMgr.m_nButtonValue = 16;
}


void CControlDlg::OnBnClickedButton33()
{//去AA上方位
	gSystemMgr.m_nButtonValue = 17;
}

void CControlDlg::OnBnClickedJackCylinder()
{
	CString str;
	GetDlgItem(IDC_JACK_CYLINDER)->GetWindowText(str);
	if (str == "托盘顶升")
	{
		gSystemMgr.m_nButtonValue = 27;
		GetDlgItem(IDC_JACK_CYLINDER)->SetWindowTextW(L"托盘下降");
	}
	if (str == "托盘下降")
	{
		gSystemMgr.m_nButtonValue = 28;
		GetDlgItem(IDC_JACK_CYLINDER)->SetWindowTextW(L"托盘顶升");
	}
}


void CControlDlg::OnBnClickedContectCylinder()
{
	// TODO: 在此添加控件通知处理程序代码
	CString str;
	GetDlgItem(IDC_CONTECT_CYLINDER)->GetWindowText(str);
	if (str == "探针上电")
	{
		gSystemMgr.m_nButtonValue = 29;
		GetDlgItem(IDC_CONTECT_CYLINDER)->SetWindowTextW(L"探针下降");
	}
	if (str == "探针下降")
	{
		gSystemMgr.m_nButtonValue = 30;
		GetDlgItem(IDC_CONTECT_CYLINDER)->SetWindowTextW(L"探针上电");
	}
}


void CControlDlg::OnBnClickedGripper()
{
	// TODO: 在此添加控件通知处理程序代码
	CString str;
	GetDlgItem(IDC_GRIPPER)->GetWindowText(str);
	if (str == "镜头夹爪开")
	{
		gSystemMgr.m_nButtonValue = 32;
		GetDlgItem(IDC_GRIPPER)->SetWindowTextW(L"镜头夹爪关");
	}
	if (str == "镜头夹爪关")
	{
		gSystemMgr.m_nButtonValue = 31;
		GetDlgItem(IDC_GRIPPER)->SetWindowTextW(L"镜头夹爪开");
	}
}


void CControlDlg::OnBnClickedStop1()
{
	// TODO: 在此添加控件通知处理程序代码
	CString str;
	GetDlgItem(IDC_STOP1)->GetWindowText(str);
	if (str == "进料阻挡升")
	{
		gSystemMgr.m_nButtonValue = 34;
		GetDlgItem(IDC_STOP1)->SetWindowTextW(L"进料阻挡降");
	}
	if (str == "进料阻挡降")
	{
		gSystemMgr.m_nButtonValue = 33;
		GetDlgItem(IDC_STOP1)->SetWindowTextW(L"进料阻挡升");
	}
}


void CControlDlg::OnBnClickedStop2()
{
	// TODO: 在此添加控件通知处理程序代码
	CString str;
	GetDlgItem(IDC_STOP2)->GetWindowText(str);
	if (str == "出料阻挡升")
	{
		gSystemMgr.m_nButtonValue = 36;
		GetDlgItem(IDC_STOP2)->SetWindowTextW(L"出料阻挡降");
	}
	if (str == "出料阻挡降")
	{
		gSystemMgr.m_nButtonValue = 35;
		GetDlgItem(IDC_STOP2)->SetWindowTextW(L"出料阻挡升");
	}
}

void CControlDlg::OnBnClickedFix1Cylinder()
{
	// TODO: 在此添加控件通知处理程序代码
	CString str;
	GetDlgItem(IDC_FIX1_CYLINDER)->GetWindowText(str);
	if (str == "下压固定开")
	{
		gSystemMgr.m_nButtonValue = 41;
		GetDlgItem(IDC_FIX1_CYLINDER)->SetWindowTextW(L"下压固定关");
	}
	if (str == "下压固定关")
	{
		gSystemMgr.m_nButtonValue = 42;
		GetDlgItem(IDC_FIX1_CYLINDER)->SetWindowTextW(L"下压固定开");
	}
}

void CControlDlg::OnBnClickedStartUv()
{
	// TODO: 在此添加控件通知处理程序代码
	CString str;
	GetDlgItem(IDC_START_UV)->GetWindowText(str);
	if (str == "UV开")
	{
		gSystemMgr.m_nButtonValue = 37;
		GetDlgItem(IDC_START_UV)->SetWindowTextW(L"UV关");
	}
	if (str == "UV关")
	{
		gSystemMgr.m_nButtonValue = 38;
		GetDlgItem(IDC_START_UV)->SetWindowTextW(L"UV开");
	}
}


void CControlDlg::OnBnClickedSafeDoor()
{
	// TODO: 在此添加控件通知处理程序代码
	CString str;
	GetDlgItem(IDC_SAFE_DOOR)->GetWindowText(str);
	if (str == "安全门开")
	{
		gSystemMgr.m_nButtonValue = 39;
		GetDlgItem(IDC_SAFE_DOOR)->SetWindowTextW(L"安全门关");
	}
	if (str == "安全门关")
	{
		gSystemMgr.m_nButtonValue = 40;
		GetDlgItem(IDC_SAFE_DOOR)->SetWindowTextW(L"安全门开");
	}
}

void CControlDlg::OnBnClickedFix2Cylinder()
{
	// TODO: 在此添加控件通知处理程序代码
	CString str;
	GetDlgItem(IDC_FIX2_CYLINDER)->GetWindowText(str);
	if (str == "横向固定开")
	{
		gSystemMgr.m_nButtonValue = 43;
		GetDlgItem(IDC_FIX2_CYLINDER)->SetWindowTextW(L"横向固定关");
	}
	if (str == "横向固定关")
	{
		gSystemMgr.m_nButtonValue = 44;
		GetDlgItem(IDC_FIX2_CYLINDER)->SetWindowTextW(L"横向固定开");
	}
}

void CControlDlg::OnBnClickedPlcRead()
{
	// TODO: 在此添加控件通知处理程序代码
	BYTE wirteb = 1;
	write_to_plc_db(gSystemMgr.Write_DB, 11, 1, &wirteb);
}


void CControlDlg::OnBnClickedPlcWrite()
{
	// TODO: 在此添加控件通知处理程序代码
	BYTE wirteb = 2;
	write_to_plc_db(gSystemMgr.Write_DB, 11, 1, &wirteb);
}


void CControlDlg::OnBnClickedPlcReadAim()
{
	// TODO: 在此添加控件通知处理程序代码
	unsigned char readb[2];
	read_from_plc_db(gSystemMgr.Write_DB, 0 + 30, 2, readb);
	int aim;
	CString str;
	ByteToInt(&aim, readb);
	str.Format(L"%d", aim);
	GetDlgItem(IDC_EDIT8)->SetWindowText(str);
	
}
void CControlDlg::ByteToInt(int *intNum, unsigned char* byteArry)////浮点数到十六进制转换2
{
	char* pchar = (char*)intNum;
	//pchar[2] = byteArry[0];
	//pchar[3] = byteArry[1];
	byteArry++;
	for (int i = 2; i < sizeof(int); i++)
	{

		*pchar = *byteArry;
		pchar++;
		byteArry--;
	}
}

void CControlDlg::OnBnClickedPlcOrder1()
{
	// TODO: 在此添加控件通知处理程序代码
	BYTE wirteb = 1;
	write_to_plc_db(gSystemMgr.Write_DB, 13, 1, &wirteb);
}


void CControlDlg::OnBnClickedPlcOrder2()
{
	// TODO: 在此添加控件通知处理程序代码
	BYTE wirteb = 2;
	write_to_plc_db(gSystemMgr.Write_DB, 13, 1, &wirteb);
}


void CControlDlg::OnBnClickedPlcOrder3()
{
	// TODO: 在此添加控件通知处理程序代码
	BYTE wirteb = 3;
	write_to_plc_db(gSystemMgr.Write_DB, 13, 1, &wirteb);
}


void CControlDlg::OnBnClickedPlcOrder4()
{
	// TODO: 在此添加控件通知处理程序代码
	BYTE wirteb = 4;
	write_to_plc_db(gSystemMgr.Write_DB, 13, 1, &wirteb);
}



void CControlDlg::OnBnClickedPlcOrder5()
{
	// TODO: 在此添加控件通知处理程序代码
	BYTE wirteb = 5;
	write_to_plc_db(gSystemMgr.Write_DB, 13, 1, &wirteb);
}


void CControlDlg::OnBnClickedPlcOrder6()
{
	// TODO: 在此添加控件通知处理程序代码
	BYTE wirteb = 6;
	write_to_plc_db(gSystemMgr.Write_DB, 13, 1, &wirteb);
}


void CControlDlg::OnBnClickedPlcReadAim2()
{
	// TODO: 在此添加控件通知处理程序代码
	unsigned char readb[2];
	read_from_plc_db(gSystemMgr.Write_DB, 0 + 32, 2, readb);
	int aim;
	CString str;
	ByteToInt(&aim, readb);
	str.Format(L"%d", aim);
	GetDlgItem(IDC_EDIT6)->SetWindowText(str);
}


void CControlDlg::OnBnClickedButton55()
{
	// TODO: 在此添加控件通知处理程序代码
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[Table_X].m_sAxisSetting.m_dTargetPos = _ttof(cstr);
	gSystemMgr.m_vCMotor[Table_X].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton57()
{
	// TODO: 在此添加控件通知处理程序代码
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[Chart_Z].m_sAxisSetting.m_dTargetPos = _ttof(cstr);
	gSystemMgr.m_vCMotor[Chart_Z].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton54()
{
	// TODO: 在此添加控件通知处理程序代码
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[Table_X].m_sAxisSetting.m_dTargetPos =- _ttof(cstr);
	gSystemMgr.m_vCMotor[Table_X].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton56()
{
	// TODO: 在此添加控件通知处理程序代码
	CString cstr;
	m_editStepDis.GetWindowTextW(cstr);
	gSystemMgr.m_vCMotor[Chart_Z].m_sAxisSetting.m_dTargetPos = -_ttof(cstr);
	gSystemMgr.m_vCMotor[Chart_Z].MotorMoveStep();
}


void CControlDlg::OnBnClickedButton34()
{
	// TODO: 在此添加控件通知处理程序代码
	gSystemMgr.m_nButtonValue = 50;
}


void CControlDlg::OnBnClickedButton35()
{
	// TODO: 在此添加控件通知处理程序代码
	gSystemMgr.m_nButtonValue = 51;
}
